<div class="box photoDetails">
	<div class="photoInfo">
		<h1>
			<?php echo smileys_parse($image->title) ?></h1>
		<div class="stats">
			<span class="views"><?php echo lang('views_count') ?>: <span class="number"><?php echo $image->views ?></span></span>
			<span class="comments"><?php echo lang('comments_count') ?>: <span class="number"><?php echo $image->comments ?></span></span>
		</div>
		<!--		<div class="source">
					<span class="source">Nguồn: 
						<span class="text">
							Tự làm
						</span>
					</span>
				</div>-->
		<div class="adminActions">
		</div>
	</div>
	<div class="uploader">
		<?php echo lang('uploaded') ?> <?php echo time2str($image->upload_date) ?> <?php echo lang('by') ?>
		<div>
			<img src="<?php echo fb_avatar($image->fb_id) ?>">
			<div class="info">
				<a href="<?php echo url_create('site', 'account', 'images', $image->user_id) ?>"><?php echo $image->fullname ?></a>
				<span title="<?php echo lang('liked') ?>" class="likes"><?php echo $uploader->likes ?></span>
			</div>
			<div class="clear">
			</div>
		</div>
	</div>
	<div class="clear">
	</div>
	<div data-fixedtop="41" class="fixedScrollDetector"></div>
	<div class="likeButton fixedScroll " style="position: relative;">
		<?php if ($image->active) { ?>
			<div class="text">
				<?php echo $image->video == 0 ? lang('like_this_pic') : lang('like_this_video') ?>
			</div>
		<?php } else { ?>
			<div class="text">
				<?php echo lang('vote_image') ?>:
			</div>
			<div class="vote">
				<div class="voteDown">
					<a href="javascript:;" data-upvote="false" data-id="<?php echo $image->id ?>" class="voteButton first<?php echo isset($image->downVoted) ? ' downVoted' : '' ?>">
						<span><?php echo lang('vote_down') ?></span></a>
				</div>
				<div class="voteUp">
					<a href="javascript:;" data-upvote="true" data-id="<?php echo $image->id ?>" class="voteButton<?php echo isset($image->upVoted) ? ' upVoted' : '' ?>">
						<span><?php echo lang('vote_up') ?></span></a>
				</div>
			</div>
		<?php } ?>
		<div class="fbLikeButton">
			<div data-href="<?php echo $image->link ?>" class="fb-like" data-send="false" data-layout="button_count" data-show-faces="true" data-font="arial"></div>
		</div>
		<div class="navButtons">
			<?php if (isset($prevImage)) { ?>
				<a title="<?php echo lang('hot_key_z') ?>" href="<?php echo url_create('site', 'photo', 'index', $prevImage) ?>" class="prev"><?php echo lang('prev_pic') ?></a>
			<?php } ?>
			<?php if (isset($nextImage)) { ?>
				<a title="<?php echo lang('hot_key_x') ?>" href="<?php echo url_create('site', 'photo', 'index', $nextImage) ?>" class="next"><?php echo lang('next_pic') ?></a>
			<?php } ?>
		</div>
	</div>
	<div class="clear">
	</div>

	<div class="photoImg">
		<?php if ($image->video == 1) { ?>
			<iframe width="600" height="350" frameborder="0" allowfullscreen="" src="<?php echo $image->path ?>"></iframe>
		<?php } else { ?>
			<img alt="<?php echo $image->title ?>" src="<?php echo image_url($image->path) ?>">    
		<?php } ?>
	</div>
	<div class="featuredFanPage">
		<h4>
			<?php echo lang('social_label2') ?>
		</h4>
		<div class="fb-like" data-href="<?php echo $social_page ?>" data-send="false"
			 data-width="600" data-show-faces="false">
		</div>
	</div>
	<div class="commentContainer">
		<h4>
			<?php echo lang('comment') ?> 
			<a class="report" href="#reportPhotoContainer">
				<?php echo lang('report_pic') ?>
			</a>
		</h4>
		<div data-href="<?php echo url_create('site', 'photo', 'index', $image->id) ?>" class="fb-comments" data-num-posts="10" data-width="655">	</div>
	</div>
</div>
<h2 style="font-size: 12px;font-weight: normal">
	<a href="<?= url_create('site', 'home', 'text') ?>" title="Anh hai">Anh hai</a> | 
	<a href="<?= url_create('site', 'home', 'video') ?>" title="Video hai">Video hai</a> | 
	<a href="<?= url_create('site', 'home', 'hot') ?>" title="Anh vui">Anh vui</a> | 
	<a href="<?= url_create('site', 'home', 'vote') ?>" title="Anh 18+">Anh 18+</a> | 
	<a href="<?= url_create('site', 'acount', 'image') ?>" title="Haivl">Haivl</a> | 
	<a href="<?= url_create('site', 'home') ?>" title="Anh hài">Ảnh hài</a> | 
	<a href="<?= url_create('site', 'home', 'video') ?>" title="video hài">Video hài</a>
</h2>
<script>
	$(window).scroll(function(){
		$('.fixedScroll').each(function(){
			var yHeader = ($('#header').position()).top+$('#header').height();
			var fixedTopDetecter = $(this).prev()
			var fixedTop = fixedTopDetecter.attr('data-fixedtop');
			var yInfo = ($(this).position()).top;
			var yThumb = fixedTopDetecter.position().top;
			if(yHeader>yInfo)
			{
				$(this).css({
					position: 'fixed',
					top: fixedTop+'px'
				})
			}
			if(yInfo<yThumb){
				$(this).css({
					position: 'relative',
					top: '0px'
				})
			}
		})
	});
	$(document).keydown(function(e){
<?php if (isset($nextImage)) { ?>
						
			if(e.keyCode==39 || e.charCode==120 || e.keyCode==88){
				window.location = '<?php echo url_create('site', 'photo', 'index', $nextImage) ?>';
			}
<?php } ?>
<?php if (isset($prevImage)) { ?>
			if(e.keyCode==37 || e.charCode==122 || e.keyCode==90){
				window.location = '<?php echo url_create('site', 'photo', 'index', $prevImage) ?>';
			}
<?php } ?>
	});
</script>